{% extends "base.html" %}

{% block js %}

<script src="/static/js/ajax.js"></script>

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){

$('form').submit(function(){
    obj = $(this);
    doPost(obj, obj.attr('action'), obj.serializeArray(), function(obj, data){
        alert('创建成功');
    });
    return false;
});

});
</script>
{% endblock %}

{% block menu %}
{% endblock %}

{% block content %}
<form action='/users' method='post'>

    用户名:<input name='username' type='text'><br>
    密码:<input name='password' type='text'><br>
    昵称:<input name='nickname' type='text'><br>
    所属公司:
    <select name="company_id">
        <option value="-1">无</option>
        {% for company in companys %}
        <option value="{{company.id}}">{{company.type}} : {{company.name}}</option>
        {% endfor %}
    </select><br>
    用户类型:
    <select name="type">
        <option value="0">普通人员</option>
        <option value="1">段长</option>
    </select><br>
    <input type='submit' value='submit'>
</form>
{% endblock %}
